<?php
// Where the file is going to be placed
// TODO here
$target_path = "./trac/uploads/CX_393/";
 
/* Add the original filename to our target path.
Result is "uploads/header/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
 
if(file_put_contents($_FILES['uploadedfile']['tmp_name'], $target_path)) {
	mkdir ($target_path, 0777);
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). " has been uploaded";
} else {
    echo "There was an error uploading the file, please try again!";
    echo "filename: " .  basename( $_FILES['uploadedfile']['name']);
    echo "target_path: " .$target_path;
}
?>